<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Fake</title>
    <link type="text/css" href="css/css.css" rel="stylesheet"/>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/js.js"></script>
    <script src="js/wb.js" type="text/javascript" charset="utf-8"></script>
 <script src="js/layer/layer.js"></script>
</head>

<body>
<div class="mianCont">
    <div class="top">
        <span id="xianshiquyu">欢迎来到Fake 请&nbsp;<a href="login-register.html">[登录/注册]</a></span>
        <span class="topRight">
    <a href="vip.html">Fake</a>&nbsp;|
    <a href="order.html">我的订单</a>&nbsp;| 
    <a href="vip.html">会员中心</a>&nbsp;|
    <a href="contact.html">联系我们</a>
   </span>
    </div><!--top/-->
    <div class="lsg">
        <h1 class="logo"><a href="index.html"><img src="images/logoA.png" width="280" height="81"/></a></h1>
        <form action="#" method="get" class="subBox">
            <div class="subBoxDiv">
                <input type="text" class="subLeft"/>
                <input type="image" src="images/subimg.png" width="63" height="34" class="sub"/>
                <div class="hotWord">
                    热门搜索：
                    <a href="proinfo.html">冷饮杯</a>&nbsp;
                    <a href="proinfo.html">热饮杯</a> &nbsp;
                    <a href="proinfo.html">纸杯</a>&nbsp;
                    <a href="proinfo.html">纸巾</a> &nbsp;
                    <a href="proinfo.html">纸巾</a> &nbsp;
                    <a href="proinfo.html">纸杯</a>&nbsp;
                </div><!--hotWord/-->
            </div><!--subBoxDiv/-->
        </form><!--subBox/-->
        <div class="gouwuche">
            <div class="gouCar">
                <img src="images/gouimg.png" width="19" height="20" style="position:relative;top:6px;"/>&nbsp;|&nbsp;
                <strong class="red" id="gwcsl">0</strong>&nbsp;件&nbsp;|
                <strong class="red" id="gwcje">￥ 0.00</strong>
                <a href="order.html">去结算</a> <img src="images/youjian.jpg" width="5" height="8"/>
            </div><!--gouCar/-->
            <div class="myChunlv">
                <a href="vip.html"><img src="images/mychunlv.jpg" width="112" height="34"/></a>
            </div><!--myChunlv/-->
        </div><!--gouwuche/-->
    </div><!--lsg/-->
    <div class="pnt">
        <div class="pntLeft">
            <h2 class="Title">所有商品分类
                <ul class="InPorNav">
                    <li><a href="product.html">纸杯系列</a>
                        <div class="chilInPorNav">
                            <a href="#">单层热饮杯</a>
                            <a href="#">双层中空杯</a>
                            <a href="#">瓦楞隔热杯</a>
                            <a href="#">双淋膜冷饮杯</a>
                            <a href="#">爆米花桶</a>
                            <a href="#">纸碗</a>
                            <a href="#">冰淇淋纸杯</a>
                            <a href="#">PS杯盖</a>
                        </div><!--chilLeftNav/-->
                    </li>
                    <li><a href="product.html">PET系列</a>
                        <div class="chilInPorNav">
                            <a href="#">PET透明杯</a>
                            <a href="#">PET透明盖</a>
                            <a href="#">PET透明沙拉盒</a>
                        </div><!--chilLeftNav/-->
                    </li>
                    <li><a href="product.html">饮品杯配套系列</a>
                        <div class="chilInPorNav">
                            <a href="#">杯袖</a>
                            <a href="#">环保纸浆杯托</a>
                            <a href="#">纸杯打包袋</a>
                            <a href="#">吸管</a>
                            <a href="#">搅拌棒</a>
                            <a href="#">杯盖</a>
                        </div><!--chilLeftNav/-->
                    </li>
                    <li><a href="product.html">纸浆环保餐具系列</a>
                        <div class="chilInPorNav">
                            <a href="#">纸碟</a>
                            <a href="#">纸碗</a>
                            <a href="#">纸浆带盖汤碗</a>
                            <a href="#">连体餐盒</a>
                            <a href="#">分体餐盒</a>
                            <a href="#">纸浆沙拉盒</a>
                            <a href="#">纸托盘</a>
                        </div><!--chilLeftNav/-->
                    </li>
                    <li><a href="product.html">纸餐盒系列</a>
                        <div class="chilInPorNav">
                            <a href="#">圆底纸餐盒</a>
                            <a href="#">方底纸餐盒</a>
                            <a href="#">三明治纸盒</a>
                            <a href="#">蛋糕盒</a>
                            <a href="#">其他纸餐盒</a>
                        </div><!--chilLeftNav/-->
                    </li>
                    <li><a href="product.html">刀叉勺餐具</a>
                        <div class="chilInPorNav">
                            <a href="#">PS刀叉勺系列</a>
                            <a href="#">PLA刀叉勺系列</a>
                            <a href="#">淀粉刀叉勺系列</a>
                            <a href="#">搅拌棒/吸管</a>
                        </div><!--chilLeftNav/-->
                    </li>
                    <li><a href="product.html">生活用纸</a>
                        <div class="chilInPorNav">
                            <a href="#">餐巾纸</a>
                            <a href="#">抽纸</a>
                            <a href="#">卫生纸</a>
                            <a href="#">擦手纸</a>
                            <a href="#">其他纸类</a>
                        </div><!--chilLeftNav/-->
                    </li>
                    <li><a href="product.html">纸袋/环保打包袋</a>
                        <div class="chilInPorNav">
                            <a href="#">纸袋</a>
                            <a href="#">环保淀粉塑料袋</a>
                            <a href="#">PLA塑料袋</a>
                            <a href="#">食品袋</a>
                        </div><!--chilLeftNav/-->
                    </li>
                </ul><!--InPorNav/-->
            </h2>
        </div><!--pntLeft/-->
        <div class="pntRight">
            <ul class="nav">
                <li><a href="index.html">商城首页</a></li>
                <li><a href="product.html">促销中心</a></li>
                <li><a href="vip.html">会员中心</a></li>
                <li class="navCur"><a href="help.html">帮助中心</a></li>
                <div class="clears"></div>
                <div class="phone">TEL：021-12345678</div>
            </ul><!--nav/-->
        </div><!--pntRight/-->
        <div class="clears"></div>
    </div><!--pnt/-->
    <div class="positions">
        当前位置：<a href="index.html">首页</a> &gt; <a href="#" class="posCur">购物车</a>
    </div><!--positions/-->


    <div class="cont">
        <div class="carImg"><img src="images/car1.jpg" width="951" height="27"/></div>

        <table class="vipAdress">
            <thead>
            <tr>
                <th>商品</th>
                <th>单价</th>
                <th>数量</th>
                <th>总金额</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody id="carBody">
            </tbody>
            <tr>
                <td colspan="6">
                    <div class="shanchu" id="delete"><img src="images/lajio.jpg"/> 全部删除</div>
                </td>
            </tr>
        </table><!--orderList/-->
        <div class="zongji">
            总计(不含运费)：<strong class="red" id="zongjia"></strong>
        </div><!--zongji/-->
        <div class="jiesuan">
            <a href="product.html" class="jie_1">继续购物&gt;&gt;</a>
            <a href="order2.html" class="jie_2">立即结算&gt;&gt;</a>
            <div class="clears"></div>
        </div><!--jiesuan/-->
        <div class="clears"></div>
    </div><!--cont/-->
    <div class="inHelp">
        <div class="inHLeft">
            <h4>帮助中心</h4>
            <ul class="inHeList">
                <li><a href="help.html">购物指南</a></li>
                <li><a href="help.html">支付方式</a></li>
                <li><a href="help.html">售后服务</a></li>
                <li><a href="about.html">企业简介</a></li>
                <div class="clears"></div>
            </ul><!--inHeList/-->
        </div><!--inHLeft/-->
        <div class="inHLeft">
            <h4>会员服务</h4>
            <ul class="inHeList">
                <li><a href="reg.html">会员注册</a></li>
                <li><a href="login.html">会员登录</a></li>
                <li><a href="order.html">购物车</a></li>
                <li><a href="order.html">我的订单</a></li>
                <div class="clears"></div>
            </ul><!--inHeList/-->
        </div><!--inHLeft/-->
        <div class="inHRight">
            <h4>全国统一免费服务热线</h4>
            <div class="telBox">400-0000-0000</div>
            <div class="weibo">
                <wb:follow-button uid="2991975565" type="red_1" width="67" height="24"></wb:follow-button>
            </div>
        </div><!--inHRight/-->
        <div class="clears"></div>
    </div><!--inHelp/-->
    <div class="footer">
        <p>
            <a href="#">进入17官网</a>&nbsp;|&nbsp;
            <a href="index.html">商城首页</a>&nbsp;|&nbsp;
            <a href="product.html">促销中心</a>&nbsp;|&nbsp;
            <a href="order.html">我的订单</a>&nbsp;|&nbsp;
            <a href="new.html">新闻动态</a>&nbsp;|&nbsp;
            <a href="login.html">会员中心</a>&nbsp;|&nbsp;
            <a href="help.htmll">帮助中心</a>
        </p>
        <p>
            版权所有：上海17实业有限公司 版权所有 Copyright 2010-2015 沪ICP备00000000号 <a href="http://www.mycodes.net/" target="_blank">源码之家</a>
        </p>
    </div><!--footer/-->
</div><!--mianCont/-->
<a href="#" class="backTop">&nbsp;</a>


<script>
    $(function () {
        seletCart();
        select_sum();
    })
    //查询总价
    function select_sum() {
        $.ajax({
            url: 'select_sum',
            data: {},
            dataType: 'json',
            type: 'post',
            success:function (data) {
                    if (data.code==200){
                        $('#zongjia').text("￥"+data.result)

                    }
            }

        })

    }
    //查询购物表
    function seletCart() {
        $('#carBody').empty();
        $.ajax({
            url: 'select_cart',
            data: {},
            dataType: 'json',
            type: 'post',
            success: function (data) {
                if (data.code == 200) {
                    $.each(data.result, function (index, obj) {
                        var tr = $('<tr ></tr>');
                        var td2 = $('<td></td>').text(obj.pname);
                        var td3 = $('<td></td>').text(obj.price);
                        var td4 = $('<td></td>').text(obj.count);
                        var td5 = $('<td></td>').text(obj.price*obj.count);
                        var td6 = $('<td></td>').html('<button type="button" onclick="delCart(' + obj.cartno + ')" class="btn btn-danger">删除</button>')
                        tr.append(td2).append(td3).append(td4).append(td5).append(td6);
                        $('#carBody').append(tr);
                    })
                } else {


                }
            }

        })

    }

    function delCart(id) {
     layer.confirm('是否确认删除该商品', {icon: 3, title: '删除提示'}, function (index) {
      $.getJSON('del_cart', {cartno: id}, function (data) {
       if (data.code == 200) {
        layer.msg(data.msg, {icon: 1, time: 2000}, function () {
         seletCart();
         select_sum();

        })
           location.reload();
       }
      })
      layer.close(index);
     });
    }
    $('#delete').click(function () {
        layer.confirm('是否确认删除全部商品', {icon: 3, title: '删除提示'}, function (index) {
            $.getJSON('deleteAll_cart', {}, function (data) {
                if (data.code == 200) {
                    layer.msg(data.msg, {icon: 1, time: 2000}, function () {
                        seletCart();

                    })
                    location.reload();
                }
            })
            layer.close(index);
        });


    })



</script>
</body>
</html>
